<html>
<head><meta charset="utf-8"><title>interactive viewer for rlibs · t-compiler/arm · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/index.html">t-compiler/arm</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/interactive.20viewer.20for.20rlibs.html">interactive viewer for rlibs</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="204324577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/interactive%20viewer%20for%20rlibs/near/204324577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/interactive.20viewer.20for.20rlibs.html#204324577">(Jul 19 2020 at 00:36)</a>:</h4>
<p>I should play around with proc macros to generate an interactive viewer (given the data types). or maybe I should just dump it all as an HTML or something and hope browsers don't die on it</p>



<a name="204324586"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/interactive%20viewer%20for%20rlibs/near/204324586" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/interactive.20viewer.20for.20rlibs.html#204324586">(Jul 19 2020 at 00:37)</a>:</h4>
<p>sometimes it's really useful to read the data, but it's somewhat intentionally not self-describing</p>



<a name="204324781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/interactive%20viewer%20for%20rlibs/near/204324781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/interactive.20viewer.20for.20rlibs.html#204324781">(Jul 19 2020 at 00:43)</a>:</h4>
<p>All I hear you say is "Wasm Wasm Wasm"</p>



<a name="204324971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/interactive%20viewer%20for%20rlibs/near/204324971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/interactive.20viewer.20for.20rlibs.html#204324971">(Jul 19 2020 at 00:49)</a>:</h4>
<p>too bad the compiler is too big for that. but maybe the relevant parts can be reasonably decoded without any dependencies hmm</p>



<a name="204325064"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/interactive%20viewer%20for%20rlibs/near/204325064" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/interactive.20viewer.20for.20rlibs.html#204325064">(Jul 19 2020 at 00:52)</a>:</h4>
<p>How big do you think is "too big"? rust-analyzer is 7MB and people want to <a href="https://github.com/integer32llc/rust-playground/issues/357#issuecomment-650822552">add it to the playground</a></p>



<a name="204325072"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/interactive%20viewer%20for%20rlibs/near/204325072" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/interactive.20viewer.20for.20rlibs.html#204325072">(Jul 19 2020 at 00:53)</a>:</h4>
<div class="codehilite"><pre><span></span><code>-rw-r--r-- 1 eddy users 9.5M Jul  9 14:42 /home/eddy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libchalk_derive-4409e2b62d415830.so
-rw-r--r-- 1 eddy users  87M Jul  9 14:42 /home/eddy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libLLVM-10-rust-1.46.0-nightly.so
-rw-r--r-- 1 eddy users 104M Jul  9 14:42 /home/eddy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-895f6d02fef171ad.so
-rw-r--r-- 1 eddy users 9.6M Jul  9 14:42 /home/eddy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_macros-6350e6adce0cda4d.so
-rw-r--r-- 1 eddy users 6.1M Jul  9 14:42 /home/eddy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libstd-b6aff3703feff874.so
-rw-r--r-- 1 eddy users 2.3M Jul  9 14:42 /home/eddy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libtest-70d03ac6bbb1c69e.so
-rw-r--r-- 1 eddy users 8.8M Jul  9 14:42 /home/eddy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/libtracing_attributes-0d61d94d9884a855.so
</code></pre></div>



<a name="204325074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/interactive%20viewer%20for%20rlibs/near/204325074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/interactive.20viewer.20for.20rlibs.html#204325074">(Jul 19 2020 at 00:53)</a>:</h4>
<p>each of the <em>proc macro crates</em> for <code>rustc_*</code> are larger than that lol</p>



<a name="204325119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/interactive%20viewer%20for%20rlibs/near/204325119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/interactive.20viewer.20for.20rlibs.html#204325119">(Jul 19 2020 at 00:55)</a>:</h4>
<p>presumably some of this will shrink on wasm but it's still a lot of code and you don't need the actual compiler, just some data descriptions</p>



<a name="204325127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/interactive%20viewer%20for%20rlibs/near/204325127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/interactive.20viewer.20for.20rlibs.html#204325127">(Jul 19 2020 at 00:55)</a>:</h4>
<p>I don't see how the size of those files would impact this. Wouldn't you just use the crates you need and let all the dead code be removed?</p>



<a name="204325165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/interactive%20viewer%20for%20rlibs/near/204325165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/interactive.20viewer.20for.20rlibs.html#204325165">(Jul 19 2020 at 00:56)</a>:</h4>
<p>the other thing is that you'd probably need to build this tool into <code>rustc</code> (as a <code>-Z</code> flag) anyway, to avoid needing to compile a separate crate against that compiler</p>



<a name="204325171"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/interactive%20viewer%20for%20rlibs/near/204325171" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/interactive.20viewer.20for.20rlibs.html#204325171">(Jul 19 2020 at 00:56)</a>:</h4>
<p>Also, you didn't answer how big is too big, an honest question of mine. Like, I don't know what's reasonable anymore.</p>



<a name="204325172"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/interactive%20viewer%20for%20rlibs/near/204325172" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/interactive.20viewer.20for.20rlibs.html#204325172">(Jul 19 2020 at 00:56)</a>:</h4>
<p>no idea!</p>



<a name="204325178"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/interactive%20viewer%20for%20rlibs/near/204325178" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/interactive.20viewer.20for.20rlibs.html#204325178">(Jul 19 2020 at 00:57)</a>:</h4>
<p>I have the bandwidth to download hundreds of MBs in the time it used to take to load a flash game back in the day</p>



<a name="204325190"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/interactive%20viewer%20for%20rlibs/near/204325190" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/interactive.20viewer.20for.20rlibs.html#204325190">(Jul 19 2020 at 00:57)</a>:</h4>
<p>Like, I'd make it opt-in. The advanced editor is opt-out. At some point theres "this is too damn big".</p>



<a name="204325191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/interactive%20viewer%20for%20rlibs/near/204325191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/interactive.20viewer.20for.20rlibs.html#204325191">(Jul 19 2020 at 00:57)</a>:</h4>
<p>I'm the wrong person to ask this I think :P</p>



<a name="204325241"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/interactive%20viewer%20for%20rlibs/near/204325241" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/interactive.20viewer.20for.20rlibs.html#204325241">(Jul 19 2020 at 00:59)</a>:</h4>
<p>it's probably easier to add some sort of a short auto-generated self-description at the start of the file to allow decoding the stuff that's not typesystem-related, anyway</p>



<a name="204335345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/interactive%20viewer%20for%20rlibs/near/204335345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/interactive.20viewer.20for.20rlibs.html#204335345">(Jul 19 2020 at 06:21)</a>:</h4>
<p>I did make a metadata viewer a while ago. It bitrotted though, as rustc_metadata has made some things private: <a href="https://github.com/bjorn3/rust_read_rlib">https://github.com/bjorn3/rust_read_rlib</a></p>



<a name="204341878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/interactive%20viewer%20for%20rlibs/near/204341878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/interactive.20viewer.20for.20rlibs.html#204341878">(Jul 19 2020 at 09:55)</a>:</h4>
<p>ahhh that's pretty fancy</p>



<a name="204341922"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/interactive%20viewer%20for%20rlibs/near/204341922" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/interactive.20viewer.20for.20rlibs.html#204341922">(Jul 19 2020 at 09:56)</a>:</h4>
<p>I was hoping to cheese it with some autoderiving. but I don't think I'll take this on any time soon, unless it's really needed for something or other</p>



<a name="204342061"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/interactive%20viewer%20for%20rlibs/near/204342061" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/interactive.20viewer.20for.20rlibs.html#204342061">(Jul 19 2020 at 10:01)</a>:</h4>
<p>Maybe it could be implemented as a <code>Serializer</code> that takes the deserialized metadata and serializes it into a human readable format?</p>



<a name="204342118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/interactive%20viewer%20for%20rlibs/near/204342118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/interactive.20viewer.20for.20rlibs.html#204342118">(Jul 19 2020 at 10:03)</a>:</h4>
<p>it's trickier than that because of <code>Lazy</code>. also because of how this sort of thing comes in handy mostly when it's not easy to link against the compiler, it might be neat to encode just enough schema to decode some of the hierarchy (I'd be happy with something that makes diffs less atrocious while not providing field names)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>